package com.umakr.ax.app.job;

import com.umakr.ax.utils.CacheUtil;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;


/**
 * 每天凌晨清除一次实名认证缓存
 *
 * @author sc
 * @date 2018/1/30
 */
@Service
@EnableScheduling
public class VerifyExpireJob {


    /**
     * 每天凌晨清除一次实名认证缓存
     */
    /**
     * //@Scheduled(cron = "0/10 * * ? * *") 每隔五秒执行一次
     * //@Scheduled(cron = "0 0/1 * * * ?")每隔1分钟
     * //@Scheduled(cron = "0 0 0 * * ?")每天凌晨0点触发
     */
    @Scheduled(cron = "0 0 0 * * ?")
    public void work(){
        String verifyKey = "verify.times.*";
        CacheUtil.getCache().delAll(verifyKey);
    }

}
